package xyz.riceball.springcloudstreambinderredis;

import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.riceball.springcloudstreambinderredis.component.RedisMessageChannelBinder;
import xyz.riceball.springcloudstreambinderredis.component.RedisProvisioningProvider;

// @checkstyle:off

/**
 * <p>
 * FileMessageBinderConfiguration
 * </p>
 *
 * @author xiaovcloud
 * @since 2024/6/13 14:15
 */
@Configuration
public class RedisMessageBinderConfiguration {
	@Bean
	@ConditionalOnMissingBean
	public RedisProvisioningProvider fileMessageBinderProvisioner() {
		return new RedisProvisioningProvider();
	}

	@Bean
	@ConditionalOnMissingBean
	public RedisMessageChannelBinder fileMessageBinder(RedisProvisioningProvider fileMessageBinderProvisioner, RedissonClient redissonClient) {
		return new RedisMessageChannelBinder(null, fileMessageBinderProvisioner, redissonClient);
	}

}
// @checkstyle:on
